home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Directorty Opus 5 - Magellan
/
Opus 5 - Magellan.iso
/
Extras
/
Select_font
/
Select.font.rexx
< prev
Wrap
OS/2 REXX Batch file
|
1996-06-22
|
2KB
|
90 lines
/*
** SelectFont.rexx
**
** written by Marcin Orlowski <carlos@dedal.man.szczecin.pl>
** <http://dedal.man.szczecin.pl/~carlos>
**
** $VER 1.00
**
** This script is designed to help user copy system fonts, which contains
** (on disk) of drawer with main fonts, and file with postfix .font.
** using DirectoryOpus. Because DOpus doesn't select .font files automatically
** (like .icon files) we have to do it ourself: by hand or... using this script.
** If you want to use this script to select something with other postfix
** (e.g .PFB, .AFM) just use your postfix as script argument:
**
** ARexx REXX:DOpus/Select.font.rexx my_postfix
**
** Default postfix is ".font".
**
** Usage: Just select drawer you want and call this script. All existing and
** connected .font files will be selected. Selected drawers which doesn't
** have its pair (.font) will be deselected (or not: depends on DESELECTWRONG
** flag -> if TRUE deselection is performed.
**
** © 1994 - W.F.M.H.
*/
OPTIONS RESULTS
TRUE = 1
FALSE = 0
NL = '0A'X
DefPostFix = '.font' /* default postfix */
DeselectWrong = FALSE /* change to TRUE if you want unpair drawers
to be deselected */
DOPUSToFront
PARSE ARG PostFix /* check for custom postfix */
IF PostFix = "" THEN PostFix = DefPostFix /* not present use default */
Status 3 /* get number of the active window */
ActiveWindow = RESULT
GetSelectedDirs '"/"' ActiveWindow
SelectedDrawers = RESULT || "/"
WordStart = 1
WordEnd = 2
Status 8 ActiveWindow /* how many selected drawers in the active window */
Licznik = RESULT
IF Licznik > 0 THEN
DO
Total = Licznik
Found = 0
Wrong = 0
DO Licznik
WordEnd=POS('/', SelectedDrawers, WordEnd);
FontName=SUBSTR(SelectedDrawers, WordStart, WordEnd-WordStart)
SelectFile FontName || PostFix 1
if (RESULT >= 0) THEN
Found = Found + 1
ELSE
DO
IF DeselectWrong THEN
SelectFile FontName 0
Wrong = Wrong + 1
END
WordEnd=WordEnd+1
WordStart=WordEnd
END
EndText = "Found " || Found || " *" || PostFix || " files."
IF ((DeselectWrong) & (Wrong>0)) THEN
EndText = EndText || " Deselected " || Wrong || " dirs."
TopText EndText
DisplayDir ActiveWindow
END
ELSE
TopText "Select any drawer first!"